Repository navigation
fix(dde-dock/media): correct media playing state and tips text - #562
Conversation
Reviewer's GuideAPIExpose trackTitle() on MediaController so callers can retrieve the current track title from the model.
ImplementationRead track and artist text from MediaModel, use “Not playing” when no track title is available, and derive subtitle text from the model metadata.
UIBuild card tips from the player name and append the track title when available, and add the translation entry for the idle title text.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="plugins/dde-dock/media/mediacontroller.cpp" line_range="439" />
<code_context>
QString MediaController::subtitleText() const
{
- if (m_mediaPlayer2) {
+ if (playing()) {
const auto metadata = m_mediaPlayer2->metadata();
const QString title = metadataText(metadata.value("xesam:title"));
</code_context>
<issue_to_address>
**Idle player name remains visible**
When playback is idle and the connected player has a nonempty app name, `subtitleText()` skips track metadata but falls through to `return m_appName`, and `MusicCard.qml` displays the nonempty subtitle, so the idle card still shows the player name.
Return an empty subtitle while playback is idle, including bypassing the `m_appName` fallback.
Also at `plugins/dde-dock/media/mediacontroller.cpp:440`.
</issue_to_address>| QString MediaController::subtitleText() const | ||
| { | ||
| if (m_mediaPlayer2) { | ||
| if (playing()) { |
There was a problem hiding this comment.
🟡 Medium · Idle player name remains visible
When playback is idle and the connected player has a nonempty app name, subtitleText() skips track metadata but falls through to return m_appName, and MusicCard.qml displays the nonempty subtitle, so the idle card still shows the player name.
Return an empty subtitle while playback is idle, including bypassing the m_appName fallback.
Also at plugins/dde-dock/media/mediacontroller.cpp:440.
Prompt for AI agents
In `plugins/dde-dock/media/mediacontroller.cpp` at line 439:
**Idle player name remains visible**
When playback is idle and the connected player has a nonempty app name, `subtitleText()` skips track metadata but falls through to `return m_appName`, and `MusicCard.qml` displays the nonempty subtitle, so the idle card still shows the player name.
Return an empty subtitle while playback is idle, including bypassing the `m_appName` fallback.
Also at `plugins/dde-dock/media/mediacontroller.cpp:440`.a11d622 to
20a4d8a
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: BLumia, wjyrich The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
1. Add trackTitle() to read title and artist from MediaModel instead of MediaPlayer2 metadata 2. Rewrite titleText() to fall back to "Not playing" when no track info is available 3. Update subtitleText() to compare artist and title from MediaModel 4. Adjust card tooltip to show "title - player" and handle empty player gracefully 5. Add "Not playing" translation entry Log: Use MediaModel as the single source for media title display Influence: Media info in the dock stays consistent with playback state fix(dde-dock/media): 统一媒体标题数据来源为 MediaModel 1. 新增 trackTitle(),从 MediaModel 读取歌名和艺术家而非 MediaPlayer2 元 数据 2. 重写 titleText(),无曲目信息时回退显示"未在播放" 3. 更新 subtitleText(),改为比较 MediaModel 中的艺术家与歌名 4. 调整卡片提示为"歌名 - 播放器",并处理播放器为空的情况 5. 新增"未在播放"翻译条目 Log: 以 MediaModel 作为媒体标题显示的唯一数据来源 Influence: 任务栏媒体信息与播放状态保持一致 PMS: BUG-384813
20a4d8a to
d896e02
Compare
|
/forcemerge |
|
This pr force merged! (status: blocked, merge_method: rebase) |
Log: Fix dock media state detection and tooltip text when idle Influence: Idle media playback now shows the player name instead of a stale track title.
fix(dde-dock/media): 修正媒体播放状态与提示文本
Log: 修复任务栏媒体状态判断及空闲时的提示文本
Influence: 空闲状态下媒体提示将显示播放器名称而非过期曲目名。
PMS: BUG-384813
Summary by Sourcery
Correct idle media state text and keep track details limited to active playback.
Bug Fixes:
Enhancements:
Chores: